package com.accloud.cloudservice;

import android.os.AsyncTask;
import com.accloud.common.ACConfiguration;
import com.accloud.service.ACMsg;

public abstract class ACBaseManager {
    private boolean isHttps;
    private String serviceName;
    private int serviceVersion;

    public ACBaseManager(String serviceName2, int serviceVersion2, boolean isHttps2) {
        this.serviceName = serviceName2;
        this.serviceVersion = serviceVersion2;
        this.isHttps = isHttps2;
    }

    public void sendReq(ACMsg req, final VoidCallback callback) {
        sendReq(req, callback, new ACMsgListener() {
            /* class com.accloud.cloudservice.ACBaseManager.AnonymousClass1 */

            @Override // com.accloud.cloudservice.ACMsgListener
            public void finish(ACMsg resp) {
                callback.success();
            }
        });
    }

    public void sendReq(ACMsg req, BaseCallback callback, ACMsgListener listener) {
        if (this.isHttps) {
            new ACServiceClient(this.serviceName, this.serviceVersion, ACConfiguration.getHttpsRouterAddr(), req, callback, listener).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
        } else {
            new ACServiceClient(this.serviceName, this.serviceVersion, ACConfiguration.getRouterAddr(), req, callback, listener).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
        }
    }
}
